ckage ytu80;

import java.util.HashMap;
import java.util.Map;

import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

public class HttpUtils {
	public static Map<String,String> httpPost(String entityParamsStr,String reqUrl) throws Exception{
		CloseableHttpResponse response = null;
		CloseableHttpClient client = null;
		try {

			HttpPost httpPost = new HttpPost(reqUrl);
			StringEntity entityParams = new StringEntity(entityParamsStr, "utf-8");
			httpPost.setEntity(entityParams);
			httpPost.setHeader("Content-Type", "text/xml;charset=ISO-8859-1");
			client = HttpClients.createDefault();
			response = client.execute(httpPost);
			if (response != null && response.getEntity() != null) {

			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (response != null) {
				response.close();
			}
			if (client != null) {
				client.close();
			}
		}
		Map<String,String> result = new HashMap<String,String>();
		return result;
	}
}

